home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / recio212.zip / spec.txt < prev    next >
Text File  |  1995-01-29  |  79KB  |  2,671 lines

  1.     Title: SPECIFICATION OF C LANGUAGE RECIO LIBRARY
  2. Copyright: (C) 1994-1995, William Pierpoint
  3.   Version: 2.12
  4.      Date: January 29, 1995
  5.  
  6.  
  7.  
  8. 1.0 RECORD INPUT/OUTPUT <recio.h>
  9.  
  10.  
  11. 1.1 Introduction
  12.  
  13. The header <recio.h> declares two types, several macros, and many functions
  14. for performing line oriented input and output.
  15.  
  16.  
  17. 1.1.1 Record Streams
  18.  
  19. Input and output are mapped into logical data record streams.  A record
  20. stream is an ordered sequence of characters composed into records, each
  21. record consisting of zero or more characters plus a terminating record
  22. delimiter character.  The terminating record delimiter for a file is the
  23. newline character.
  24.  
  25. Each record consists of zero or more fields.  The record may be broken
  26. into fields in two different ways: (1) character delimited and (2) column
  27. delimited.  For character delimited fields, each field consists of zero or
  28. more characters plus a terminating field delimiter character or, for the
  29. last field in the record, the record delimiter character.  For column
  30. delimited fields, each field consists of one or more characters delimited
  31. by a single column position for fields consisting of one character, or by
  32. beginning and ending column positions for fields consisting of one or more
  33. characters.
  34.  
  35. Four types of fields are defined: (1) character, (2) text, (3) numeric, and
  36. (4) time.  A character field consists of a single character.  A text field
  37. consists of a sequence of zero or more characters delimited at each end by an
  38. optional text delimiter character.  A numeric field consists of a sequence of
  39. one or more characters from the set of valid characters for the number type
  40. (integral or floating point) and radix.  A time field consists of a sequence
  41. of one or more characters from the set of valid characters for the time type,
  42. delimited according to a specified format string.
  43.  
  44.  
  45. 1.1.2 Types
  46.  
  47. The types are
  48.  
  49.     REC
  50.  
  51. which is an object type capable of recording all information needed to
  52. control a record stream used for line oriented input or output, including
  53. its file pointer, pointers to its associated record and field buffers, field
  54. and text delimiting characters, an error indicator that records whether
  55. an error has occurred, and an end-of-file indicator that records whether
  56. the end of the file has been reached; and
  57.  
  58.     rpos_t
  59.  
  60. which is an object type capable of recording all the information needed to
  61. specify uniquely any field position within a record.
  62.  
  63.  
  64. 1.1.3 Macros
  65.  
  66. The macros are
  67.  
  68.     RECBUFSIZ
  69.     FLDBUFSIZ
  70.  
  71. which expand to integral constant expressions, which are the initial
  72. sizes of the record buffer and the field buffer;
  73.  
  74.     RECFLDCH
  75.     RECTXTCH
  76.  
  77. which expand to integral constant expressions, which are the default
  78. values of the characters used to separate the fields and delimit text
  79. in a record and whose default value shall correspond to the value of
  80. the space character;
  81.  
  82.     ROPEN_MAX
  83.  
  84. which expands to an integral constant expression that is the maximum
  85. number of files that can be open simultaneously;
  86.  
  87.     RECIN
  88.     RECOUT
  89.     RECERR
  90.  
  91. which expand to an integral constant expression that is the context
  92. number for the recin record stream that gets input from the <stdio.h>
  93. standard input stream stdin, the recout record stream that puts output
  94. to the <stdio.h> standard output stream stdout, and the recerr record
  95. stream that puts output to the <stdio.h> standard error stream stderr.
  96.  
  97.  
  98. 1.1.4 Expressions
  99.  
  100. The expressions are
  101.  
  102.     recin
  103.     recout
  104.     recerr
  105.  
  106. which are of type "pointer to REC" that points to the REC object associated
  107. with the <stdio.h> FILE objects stdin (standard input stream), stdout
  108. (standard output stream), and stderr (standard error stream).  The recin,
  109. recout, and recerr record streams are always open and are included in the
  110. count of ROPEN_MAX.
  111.  
  112.  
  113.  
  114. 1.2 Record Access Functions
  115.  
  116. 1.2.1 The rclose Function
  117.  
  118. Synopsis
  119.  
  120.      #include <recio.h>
  121.      void rclose(REC *rp);
  122.  
  123. Description
  124.  
  125. The rclose function causes the record stream pointed to by rp and the
  126. associated file to be closed.  Any unread data is discarded.  The record
  127. stream is disassociated from the file.  If associated buffers were
  128. automatically allocated, they are deallocated.
  129.  
  130. If an error occurs, the error indicator for the record stream is set and
  131. the callback error function is called.
  132.  
  133. Returns
  134.  
  135. The rclose function returns no value.
  136.  
  137.  
  138. 1.2.2 The rcloseall Function
  139.  
  140. Synopsis
  141.  
  142.      #include <recio.h>
  143.      int rcloseall(void);
  144.  
  145. Description
  146.  
  147. The rcloseall function causes all the open record streams, and all the
  148. files associated with the open record streams, to be closed.  Any unread
  149. data is discarded.  Each record stream is disassociated from its file.
  150. If associated buffers were automatically allocated, they are deallocated.
  151.  
  152. Returns
  153.  
  154. The rcloseall function returns the number of record streams successfully
  155. closed.
  156.  
  157.  
  158. 1.2.3 The ropen Function
  159.  
  160. Synopsis
  161.  
  162.      #include <recio.h>
  163.      REC *ropen(const char *filename, const char *mode);
  164.  
  165. Description
  166.  
  167. The ropen function opens the file whose name is the string pointed to by
  168. filename, and associates a record stream with it.  The argument mode
  169. points to a string whose first letter is:
  170.  
  171.        "r" - open text file for input
  172.        "w" - open text file for output
  173.        "a" - open text file for append
  174.  
  175. When successfully opened, the error and end-of-file indicators for the
  176. record stream are clear.  If an error occurs, errno is set to one of the
  177. error reporting macros as defined in <errno.h>, the callback error function
  178. is called (except when the file associated with filename is not able to be
  179. opened), and a null pointer is returned.
  180.  
  181. Returns
  182.  
  183. The ropen function returns a pointer to the object controlling the record
  184. stream.  If the open operation fails, ropen returns a null pointer.
  185.  
  186.  
  187. 1.2.4 The rsetfldsiz Function
  188.  
  189. Synopsis
  190.  
  191.      #include <recio.h>
  192.      void rsetfldsiz(REC *rp, size_t fldsize);
  193.  
  194. Description
  195.  
  196. The rsetfldsiz function reallocates the field buffer associated with the
  197. record stream pointed to by rp to the new size of fldsize.
  198.  
  199. The rsetfldsiz function may be used only after the record stream pointed
  200. to by rp has been opened and before any data is read into the record
  201. buffer.  Data is read into the record buffer by the function rgetrec,
  202. or by calling a function that either skips a field or gets data from a
  203. field.  If rsetfldsiz is not used, the initial size of the field buffer
  204. is set by the value of the macro FLDBUFSIZ.
  205.  
  206. If an error occurs, the error indicator for the record stream is set and
  207. the callback error function is called.
  208.  
  209. Returns
  210.  
  211. The rsetfldsiz function returns no value.
  212.  
  213.  
  214. 1.2.5 The rsetrecsiz Function
  215.  
  216. Synopsis
  217.  
  218.      #include <recio.h>
  219.      void rsetrecsiz(REC *rp, size_t recsize);
  220.  
  221. Description
  222.  
  223. The rsetrecsiz function reallocates the record buffer associated with the
  224. record stream pointed to by rp to the new size of recsize.
  225.  
  226. The rsetrecsiz function may be used only after the record stream pointed
  227. to by rp has been opened and before any data is read into the record
  228. buffer.  Data is read into the record buffer by the function rgetrec,
  229. or by calling a function that either skips a field or gets data from a
  230. field.  If rsetrecsiz is not used, the initial size of the field buffer
  231. is set by the value of the macro RECBUFSIZ.
  232.  
  233. If an error occurs, the error indicator for the record stream is set and
  234. the callback error function is called.
  235.  
  236. Returns
  237.  
  238. The rsetrecsiz function returns no value.
  239.  
  240.  
  241.  
  242. 1.3 Character Delimited Field Input Functions
  243.  
  244. The character delimited field input functions use a character (such as
  245. a comma or space) to determine where each field begins and ends.
  246.  
  247.  
  248. 1.3.1 The rbgeti Function
  249.  
  250. Synopsis
  251.  
  252.      #include <recio.h>
  253.      int rbgeti(REC *rp, int base);
  254.  
  255. Description
  256.  
  257. The rbgeti function reads a field consisting of one integral number
  258. represented by the radix determined by the value of base from the input
  259. record stream pointed to by rp.  Any leading or trailing white space
  260. in the field is ignored.
  261.  
  262. Base may be zero or in the range of 2 to 36 inclusive.  If the value of
  263. base is zero, the expected form of the integral number is described by
  264. section 3.1.3.2 of ANSI X3.159-1989.
  265.  
  266. If an error occurs, the error indicator for the record stream is set,
  267. the callback error function is called, and the function returns zero.
  268.  
  269. Returns
  270.  
  271. The rbgeti function returns a signed integer from the input record
  272. stream pointed to by rp.  If an attempt is made to read beyond the
  273. end-of-record, if the field is empty, or if there is an illegal character
  274. in the field, the error indicator for the record stream is set, and rbgeti
  275. returns zero.  If the record stream is at end-of-file (end-of-file indicator
  276. set), rbgeti returns zero.  If a previous error has occurred on the record
  277. stream that has not been cleared (error indicator set), rbgeti returns zero.
  278.  
  279.  
  280. 1.3.2 The rbgetl Function
  281.  
  282. Synopsis
  283.  
  284.      #include <recio.h>
  285.      long rbgetl(REC *rp, int base);
  286.  
  287. Description
  288.  
  289. The rbgetl function reads a field consisting of one integral number
  290. represented by the radix determined by the value of base from the input
  291. record stream pointed to by rp.  Any leading or trailing white space
  292. in the field is ignored.
  293.  
  294. Base may be zero or in the range of 2 to 36 inclusive.  If the value of
  295. base is zero, the expected form of the integral number is described by
  296. section 3.1.3.2 of ANSI X3.159-1989.
  297.  
  298. If an error occurs, the error indicator for the record stream is set,
  299. the callback error function is called, and the function returns zero (0L).
  300.  
  301. Returns
  302.  
  303. The rbgetl function returns a signed long from the input record stream
  304. pointed to by rp.  If an attempt is made to read beyond the end-of-record,
  305. if the field is empty, or if there is an illegal character in the field,
  306. the error indicator for the record stream is set, and rbgetl returns zero
  307. (0L).  If the record stream is at end-of-file (end-of-file indicator set),
  308. rbgetl returns zero (0L).  If a previous error has occurred on the record
  309. stream that has not been cleared (error indicator set), rbgetl returns
  310. zero (0L).
  311.  
  312.  
  313. 1.3.3 The rbgetui Function
  314.  
  315. Synopsis
  316.  
  317.      #include <recio.h>
  318.      unsigned int rbgetui(REC *rp, int base);
  319.  
  320. Description
  321.  
  322. The rbgetui function reads a field consisting of one non-negative integral
  323. number represented by the radix determined by the value of base from the
  324. input record stream pointed to by rp.  Any leading or trailing white space
  325. in the field is ignored.
  326.  
  327. Base may be zero or in the range of 2 to 36 inclusive.  If the value of
  328. base is zero, the expected form of the integral number is described by
  329. section 3.1.3.2 of ANSI X3.159-1989.
  330.  
  331. If an error occurs, the error indicator for the record stream is set,
  332. the callback error function is called, and the function returns zero.
  333.  
  334. Returns
  335.  
  336. The rbgetui function returns an unsigned integer from the input record
  337. stream pointed to by rp.  If an attempt is made to read beyond the
  338. end-of-record, if the field is empty, or if there is an illegal character
  339. in the field, the error indicator for the record stream is set, and rbgetui
  340. returns zero.  If the record stream is at end-of-file (end-of-file indicator
  341. set), rbgetui returns zero.  If a previous error has occurred on the record
  342. stream that has not been cleared (error indicator set), rbgetui returns zero.
  343.  
  344.  
  345. 1.3.4 The rbgetul Function
  346.  
  347. Synopsis
  348.  
  349.      #include <recio.h>
  350.      unsigned long rbgetul(REC *rp, int base);
  351.  
  352. Description
  353.  
  354. The rbgetul function reads a field consisting of one non-negative integral
  355. number represented by the radix determined by the value of base from the
  356. input record stream pointed to by rp.  Any leading or trailing white space
  357. in the field is ignored.
  358.  
  359. Base may be zero or in the range of 2 to 36 inclusive.  If the value of
  360. base is zero, the expected form of the integral number is described by
  361. section 3.1.3.2 of ANSI X3.159-1989.
  362.  
  363. If an error occurs, the error indicator for the record stream is set,
  364. the callback error function is called, and the function returns zero (0L).
  365.  
  366. Returns
  367.  
  368. The rbgetul function returns an unsigned long from the input record stream
  369. pointed to by rp.  If an attempt is made to read beyond the end-of-record,
  370. if the field is empty, or if there is an illegal character in the field,
  371. the error indicator for the record stream is set, and rbgetul returns zero
  372. (0L).  If the record stream is at end-of-file (end-of-file indicator set),
  373. rbgetul returns zero (0L).  If a previous error has occurred on the record
  374. stream that has not been cleared (error indicator set), rbgetul returns
  375. zero (0L).
  376.  
  377.  
  378. 1.3.5 The rgetc Function
  379.  
  380. Synopsis
  381.  
  382.      #include <recio.h>
  383.      int rgetc(REC *rp);
  384.  
  385. Description
  386.  
  387. The rgetc function reads a field consisting of one non-white space
  388. character from the input record stream pointed to by rp.  Any leading
  389. or trailing white space in the field is ignored.
  390.  
  391. If an error occurs, the error indicator for the record stream is set,
  392. the callback error function is called, and the function returns EOF.
  393.  
  394. Returns
  395.  
  396. The rgetc function returns a character from a single non-white
  397. space character field in the input record stream pointed to by rp.
  398. If an attempt is made to read beyond the end-of-record, or if there
  399. is more than or less than one non-white character in the field, the
  400. error indicator for the record stream is set, and rgetc returns EOF.  If the
  401. record stream is at end-of-file (end-of-file indicator set), rgetc returns
  402. EOF.  If a previous error has occurred on the record stream that has not been
  403. cleared (error indicator set), rgetc returns EOF.
  404.  
  405.  
  406. 1.3.6 The rgetd Function
  407.  
  408. Synopsis
  409.  
  410.      #include <recio.h>
  411.      double rgetd(REC *rp);
  412.  
  413. Description
  414.  
  415. The rgetd function reads a field consisting of one floating point
  416. number from the input record stream pointed to by rp.  Any leading
  417. or trailing white space in the field is ignored.
  418.  
  419. If an error occurs, the error indicator for the record stream is set,
  420. the callback error function is called, and the function returns zero.
  421.  
  422. Returns
  423.  
  424. The rgetd function returns a double precision floating point number
  425. from the input record stream pointed to by rp.  If an attempt is made
  426. to read beyond the end-of-record, if the field is empty, or if there
  427. is an illegal character in the field, the error indicator for the
  428. record stream is set, and rgetd returns zero (0.0).  If the record stream is
  429. at end-of-file (end-of-file indicator set), rgetd returns zero (0.0).  If a
  430. previous error has occurred on the record stream that has not been cleared
  431. (error indicator set), rgetd returns zero (0.0).
  432.  
  433.  
  434. 1.3.7 The rgetf Function
  435.  
  436. Synopsis
  437.  
  438.      #include <recio.h>
  439.      float rgetf(REC *rp);
  440.  
  441. Description
  442.  
  443. The rgetf function reads a field consisting of one floating point
  444. number from the input record stream pointed to by rp.  Any leading
  445. or trailing white space in the field is ignored.
  446.  
  447. If an error occurs, the error indicator for the record stream is set,
  448. the callback error function is called, and the function returns zero.
  449.  
  450. Returns
  451.  
  452. The rgetf function returns a single precision floating point number
  453. from the input record stream pointed to by rp.  If an attempt is made
  454. to read beyond the end-of-record, if the field is empty, or if there
  455. is an illegal character in the field, the error indicator for the
  456. record stream is set, and rgetf returns zero (0.0).  If the record stream is
  457. at end-of-file (end-of-file indicator set), rgetf returns zero (0.0).  If a
  458. previous error has occurred on the record stream that has not been cleared
  459. (error indicator set), rgetf returns zero (0.0).
  460.  
  461.  
  462. 1.3.8 The rgeti Function
  463.  
  464. Synopsis
  465.  
  466.      #include <recio.h>
  467.      int rgeti(REC *rp);
  468.  
  469. Description
  470.  
  471. The rgeti function reads a field consisting of one integral
  472. number from the input record stream pointed to by rp.  Any leading
  473. or trailing white space in the field is ignored.
  474.  
  475. If an error occurs, the error indicator for the record stream is set,
  476. the callback error function is called, and the function returns zero.
  477.  
  478. Returns
  479.  
  480. The rgeti function returns a signed integer from the input record
  481. stream pointed to by rp.  If an attempt is made to read beyond the
  482. end-of-record, if the field is empty, or if there is an illegal character
  483. in the field, the error indicator for the record stream is set, and rgeti
  484. returns zero.  If the record stream is at end-of-file (end-of-file indicator
  485. set), rgeti returns zero.  If a previous error has occurred on the record
  486. stream that has not been cleared (error indicator set), rgeti returns zero.
  487.  
  488.  
  489. 1.3.9 The rgetl Function
  490.  
  491. Synopsis
  492.  
  493.      #include <recio.h>
  494.      long rgetl(REC *rp);
  495.  
  496. Description
  497.  
  498. The rgetl function reads a field consisting of one integral number
  499. from the input record stream pointed to by rp.  Any leading or trailing
  500. white space in the field is ignored.
  501.  
  502. If an error occurs, the error indicator for the record stream is set,
  503. the callback error function is called, and the function returns zero (0L).
  504.  
  505. Returns
  506.  
  507. The rgetl function returns a signed long from the input record stream
  508. pointed to by rp.  If an attempt is made to read beyond the end-of-record,
  509. if the field is empty, or if there is an illegal character in the field,
  510. the error indicator for the record stream is set, and rgetl returns zero
  511. (0L).  If the record stream is at end-of-file (end-of-file indicator set),
  512. rgetl returns zero (0L).  If a previous error has occurred on the record
  513. stream that has not been cleared (error indicator set), rgetl returns zero
  514. (0L).
  515.  
  516.  
  517. 1.3.10 The rgets Function
  518.  
  519. Synopsis
  520.  
  521.      #include <recio.h>
  522.      char *rgets(REC *rp);
  523.  
  524. Description
  525.  
  526. The rgets function reads a field consisting of one text string from the
  527. input record stream pointed to by rp.  Any leading white space before the
  528. text delimiter and any trailing white space after the text delimiter in
  529. the field is ignored.  The text delimiters are not returned as part of
  530. the string.
  531.  
  532. If an error occurs, the error indicator for the record stream is set, the
  533. callback error function is called, and the function returns a pointer to
  534. an empty string.
  535.  
  536. Returns
  537.  
  538. The rgets function returns a pointer to a character array from the input
  539. record stream pointed to by rp.  If an attempt is made to read beyond the
  540. end-of-record, the error indicator for the record stream is set, and rgets
  541. returns a pointer to an empty string.  If the record stream is at end-of-file
  542. (end-of-file indicator set), rgets returns a pointer to an empty string.  If
  543. a previous error has occurred on the record stream that has not been cleared
  544. (error indicator set), rgets returns a pointer to an empty string.
  545.  
  546.  
  547. 1.3.11 The rgett Function
  548.  
  549. Synopsis
  550.  
  551.      #include <recio.h>
  552.      time_t rgett(REC *rp);
  553.  
  554. Description
  555.  
  556. The rgett function reads a field consisting of one time of type time_t from
  557. input record stream pointed to by rp.  Any leading or trailing white space
  558. in the field is ignored.
  559.  
  560. If an error occurs, the error indicator for the record stream is set, the
  561. callback error function is called, and the function returns (time_t)-1.
  562.  
  563. Returns
  564.  
  565. The rgett function returns a time of type time_t.  If an attempt is made to
  566. read beyond the end-of-record, the error indicator for the record stream is
  567. set, and rgett returns (time_t)-1.  If the record stream is at end-of-file
  568. (end-of-file indicator set), rgett returns (time_t)-1.  If a previous error
  569. has occurred on the record stream that has not been cleared (error indicator
  570. set), rgett returns (time_t)-1.
  571.  
  572.  
  573. 1.3.12 The rgettm Function
  574.  
  575. Synopsis
  576.  
  577.      #include <recio.h>
  578.      struct tm rgettm(REC *rp);
  579.  
  580. Description
  581.  
  582. The rgettm function reads a field consisting of one time of type struct tm
  583. from input record stream pointed to by rp.  Any leading or trailing white
  584. space in the field is ignored.
  585.  
  586. If an error occurs, the error indicator for the record stream is set, the
  587. callback error function is called, and the function returns an implementation
  588. defined value.
  589.  
  590. Returns
  591.  
  592. The rgettm function returns a time of type struct tm.  If an attempt is made
  593. to read beyond the end-of-record, the error indicator for the record stream
  594. is set, and rgettm returns an implementation defined value.  If the record
  595. stream is at end-of-file (end-of-file indicator set), rgettm returns an
  596. implementation defined value.  If a previous error has occurred on the
  597. record stream that has not been cleared (error indicator set), rgettm returns
  598. an implementation defined value.
  599.  
  600.  
  601. 1.3.13 The rgetui Function
  602.  
  603. Synopsis
  604.  
  605.      #include <recio.h>
  606.      unsigned int rgetui(REC *rp);
  607.  
  608. Description
  609.  
  610. The rgetui function reads a field consisting of one non-negative
  611. integral number from the input record stream pointed to by rp.  Any
  612. leading or trailing white space in the field is ignored.
  613.  
  614. If an error occurs, the error indicator for the record stream is set,
  615. the callback error function is called, and the function returns zero.
  616.  
  617. Returns
  618.  
  619. The rgetui function returns an unsigned integer from the input record
  620. stream pointed to by rp.  If an attempt is made to read beyond the
  621. end-of-record, if the field is empty, or if there is an illegal character
  622. in the field, the error indicator for the record stream is set, and rgetui
  623. returns zero.  If the record stream is at end-of-file (end-of-file indicator
  624. set), rgetui returns zero.  If a previous error has occurred on the record
  625. stream that has not been cleared (error indicator set), rgetui returns zero.
  626.  
  627.  
  628. 1.3.14 The rgetul Function
  629.  
  630. Synopsis
  631.  
  632.      #include <recio.h>
  633.      unsigned long rgetul(REC *rp);
  634.  
  635. Description
  636.  
  637. The rgetul function reads a field consisting of one non-negative
  638. integral number from the input record stream pointed to by rp.  Any
  639. leading or trailing white space in the field is ignored.
  640.  
  641. If an error occurs, the error indicator for the record stream is set, the
  642. callback error function is called, and the function returns zero (0L).
  643.  
  644. Returns
  645.  
  646. The rgetul function returns an unsigned long from the input record stream
  647. pointed to by rp.  If an attempt is made to read beyond the end-of-record,
  648. if the field is empty, or if there is an illegal character in the field,
  649. the error indicator for the record stream is set, and rgetul returns zero
  650. (0L).  If the record stream is at end-of-file (end-of-file indicator set),
  651. rgetul returns zero (0L).  If a previous error has occurred on the record
  652. stream that has not been cleared (error indicator set), rgetul returns zero
  653. (0L).
  654.  
  655.  
  656. 1.3.15 The rsetfldch Function
  657.  
  658. Synopsis
  659.  
  660.      #include <recio.h>
  661.      void rsetfldch(REC *rp, int ch);
  662.  
  663. Description
  664.  
  665. The rsetfldch function sets the field delimiter to the character ch
  666. for the record stream pointed to by rp.  If the character ch is the
  667. space character ' ', then the field is delimited by any white-space,
  668. and multiple contiguous white space characters are treated as a single
  669. delimiter.  If the character ch is other than the space character, then
  670. multiple contiguous field delimiters are treated as a series of empty
  671. fields.
  672.  
  673. If rsetfldch is not called, the field delimiter is set by the value of
  674. the macro RECFLDCH.
  675.  
  676. If an error occurs, the error indicator for the record stream is set and
  677. the callback error function is called.
  678.  
  679. Returns
  680.  
  681. The rsetfldch function returns no value.
  682.  
  683.  
  684. 1.3.16 The rsettmfmt Function
  685.  
  686. Synopsis
  687.  
  688.      #include <recio.h>
  689.      void rsettmfmt(REC *rp, char *fmt);
  690.  
  691. Description
  692.  
  693. The rsettmfmt function sets the time format according to the string fmt
  694. for the record stream pointed to by rp.
  695.  
  696. Time formats are specified using a subset of the specifiers from the
  697. ANSI-C strftime function.  Supported specifiers are:
  698.  
  699.         %d - day of month (1-31)
  700.         %H - hour from 24-hour clock (0-23)
  701.         %m - month (1-12)
  702.         %M - minute (0-59)
  703.         %s - second (0-61)
  704.         %y - year without century (00-99)
  705.         %Y - year with century (e.g. 1994)
  706.  
  707. If the rsettmfmt function is not called, the time format is set to
  708. "%m/%d/%y".
  709.  
  710. If an error occurs, the error indicator for the record stream is set
  711. and the callback error function is called.
  712.  
  713. Returns
  714.  
  715. The rsettmfmt function returns no value.
  716.  
  717.  
  718. 1.3.17 The rsettxtch Function
  719.  
  720. Synopsis
  721.  
  722.      #include <recio.h>
  723.      void rsettxtch(REC *rp, int ch);
  724.  
  725. Description
  726.  
  727. The rsettxtch function sets the text delimiter to the character ch for
  728. the record stream pointed to by rp.
  729.  
  730. If rsettxtch is not called, the text delimiter is set by the value of
  731. the macro RECTXTCH.
  732.  
  733. If an error occurs, the error indicator for the record stream is set and
  734. the callback error function is called.
  735.  
  736. Returns
  737.  
  738. The rsettxtch function returns no value.
  739.  
  740.  
  741. 1.3.18 The rskipfld Function
  742.  
  743. Synopsis
  744.  
  745.      #include <recio.h>
  746.      unsigned int rskipfld(REC *rp);
  747.  
  748. Description
  749.  
  750. The rskipfld function skips to the next field for the record stream
  751. pointed to by rp.
  752.  
  753. If an error occurs, the error indicator for the record stream is set,
  754. the callback error function is called, and the function returns 0.
  755.  
  756. Returns
  757.  
  758. The rskipfld function returns one if the field was successfully skipped,
  759. or zero if the field could not be skipped either because you are at the
  760. end of the record or because an error occurred.
  761.  
  762.  
  763. 1.3.19 The rskipnfld Function
  764.  
  765. Synopsis
  766.  
  767.      #include <recio.h>
  768.      unsigned int rskipnfld(REC *rp, unsigned int num);
  769.  
  770. Description
  771.  
  772. The rskipnfld function skips over num number of fields for the record
  773. stream pointed to by rp.
  774.  
  775. If an error occurs, the error indicator for the record stream is set,
  776. the callback error function is called, and the function returns 0.
  777.  
  778. Returns
  779.  
  780. The rskipfld function returns the actual number of fields skipped.
  781.  
  782.  
  783. 1.3.20 The ristxtfld Function
  784.  
  785. Synopsis
  786.  
  787.     #include <recio.h>
  788.     unsigned ristxtfld(REC *rp);
  789.  
  790. Description
  791.  
  792. The ristxtfld function determines if the current field (the field most
  793. recently input or output) for the record stream pointed to by rp was
  794. quoted with the text delimiter character (provided the text delimiter
  795. character is not the space character).
  796.  
  797. Returns
  798.  
  799. The ristxtfld function returns non-zero if the current field was quoted
  800. and returns zero otherwise.  If the text delimiter character for the stream
  801. is the space character, the ristxtfld function always returns zero.
  802.  
  803.  
  804.  
  805. 1.4 Character Delimited Field Output Functions
  806.  
  807. The character delimited field output functions automatically place the
  808. field delimiter character between fields in the output.
  809.  
  810.  
  811. 1.4.1 The rbputi Function
  812.  
  813. Synopsis
  814.  
  815.      #include <recio.h>
  816.      void rbputi(REC *rp, int base, int number);
  817.  
  818. Description
  819.  
  820. The rbputi function writes an integral number in the radix base to the
  821. output record stream pointed to by rp.  Base may be between 2 to 36.
  822.  
  823. If an error occurs, the error indicator for the record stream is set and
  824. the callback error function is called.
  825.  
  826. Returns
  827.  
  828. The rbputi function returns no value.
  829.  
  830.  
  831. 1.4.2 The rbputl Function
  832.  
  833. Synopsis
  834.  
  835.      #include <recio.h>
  836.      void rbputl(REC *rp, int base, long number);
  837.  
  838. Description
  839.  
  840. The rbputl function writes an integral number in the radix base to the
  841. output record stream pointed to by rp.  Base may be between 2 to 36.
  842.  
  843. If an error occurs, the error indicator for the record stream is set and
  844. the callback error function is called.
  845.  
  846. Returns
  847.  
  848. The rbputl function returns no value.
  849.  
  850.  
  851. 1.4.3 The rbputui Function
  852.  
  853. Synopsis
  854.  
  855.      #include <recio.h>
  856.      void rbputui(REC *rp, int base, unsigned int number);
  857.  
  858. Description
  859.  
  860. The rbputui function writes an unsigned integral number in the radix base to
  861. the output record stream pointed to by rp.  Base may be between 2 to 36.
  862.  
  863. If an error occurs, the error indicator for the record stream is set and
  864. the callback error function is called.
  865.  
  866. Returns
  867.  
  868. The rbputui function returns no value.
  869.  
  870.  
  871. 1.4.4 The rbputul Function
  872.  
  873. Synopsis
  874.  
  875.      #include <recio.h>
  876.      void rbputul(REC *rp, int base, unsigned long number);
  877.  
  878. Description
  879.  
  880. The rbputul function writes an unsigned integral number in the radix base to
  881. the output record stream pointed to by rp.  Base may be between 2 to 36.
  882.  
  883. If an error occurs, the error indicator for the record stream is set and
  884. the callback error function is called.
  885.  
  886. Returns
  887.  
  888. The rbputul function returns no value.
  889.  
  890.  
  891. 1.4.5 The rputc Function
  892.  
  893. Synopsis
  894.  
  895.      #include <recio.h>
  896.      void rputc(REC *rp, int ch);
  897.  
  898. Description
  899.  
  900. The rputc function writes a character ch to the output record stream
  901. pointed to by rp.
  902.  
  903. If an error occurs, the error indicator for the record stream is set and
  904. the callback error function is called.
  905.  
  906. Returns
  907.  
  908. The rputc function returns no value.
  909.  
  910.  
  911. 1.4.6 The rputd Function
  912.  
  913. Synopsis
  914.  
  915.      #include <recio.h>
  916.      void rputd(REC *rp, double number);
  917.  
  918. Description
  919.  
  920. The rputd function writes a floating point number to the output record
  921. stream pointed to by rp.
  922.  
  923. If an error occurs, the error indicator for the record stream is set and
  924. the callback error function is called.
  925.  
  926. Returns
  927.  
  928. The rputd function returns no value.
  929.  
  930.  
  931. 1.4.7 The rputf Function
  932.  
  933. Synopsis
  934.  
  935.      #include <recio.h>
  936.      void rputf(REC *rp, float number);
  937.  
  938. Description
  939.  
  940. The rputf function writes a floating point number to the output record
  941. stream pointed to by rp.
  942.  
  943. If an error occurs, the error indicator for the record stream is set and
  944. the callback error function is called.
  945.  
  946. Returns
  947.  
  948. The rputf function returns no value.
  949.  
  950.  
  951. 1.4.8 The rputi Function
  952.  
  953. Synopsis
  954.  
  955.      #include <recio.h>
  956.      void rputi(REC *rp, int number);
  957.  
  958. Description
  959.  
  960. The rputi function writes an integral number to the output record stream
  961. pointed to by rp.
  962.  
  963. If an error occurs, the error indicator for the record stream is set and
  964. the callback error function is called.
  965.  
  966. Returns
  967.  
  968. The rputi function returns no value.
  969.  
  970.  
  971. 1.4.9 The rputl Function
  972.  
  973. Synopsis
  974.  
  975.      #include <recio.h>
  976.      void rputl(REC *rp, long number);
  977.  
  978. Description
  979.  
  980. The rputl function writes an integral number to the output record stream
  981. pointed to by rp.
  982.  
  983. If an error occurs, the error indicator for the record stream is set and
  984. the callback error function is called.
  985.  
  986. Returns
  987.  
  988. The rputl function returns no value.
  989.  
  990.  
  991. 1.4.10 The rputs Function
  992.  
  993. Synopsis
  994.  
  995.      #include <recio.h>
  996.      void rputs(REC *rp, char *string);
  997.  
  998. Description
  999.  
  1000. The rputs function writes a string of characters to the output record
  1001. stream pointed to by rp.  If the text delimiter character is not the space
  1002. character, text delimiters are placed around the text.
  1003.  
  1004. If an error occurs, the error indicator for the record stream is set and
  1005. the callback error function is called.
  1006.  
  1007. Returns
  1008.  
  1009. The rputs function returns no value.
  1010.  
  1011.  
  1012. 1.4.11 The rputt Function
  1013.  
  1014. Synopsis
  1015.  
  1016.      #include <recio.h>
  1017.      void rputt(REC *rp, time_t time);
  1018.  
  1019. Description
  1020.  
  1021. The rputt function writes the time to the output record stream pointed to by
  1022. rp.  The format of the time is determined by the time format for the record
  1023. stream.  See section 1.3.16 on how to set the time format.
  1024.  
  1025. If an error occurs, the error indicator for the record stream is set and
  1026. the callback error function is called.
  1027.  
  1028. Returns
  1029.  
  1030. The rputt function returns no value.
  1031.  
  1032.  
  1033. 1.4.12 The rputtm Function
  1034.  
  1035. Synopsis
  1036.  
  1037.      #include <recio.h>
  1038.      void rputtm(REC *rp, struct tm t);
  1039.  
  1040. Description
  1041.  
  1042. The rputtm function writes out the time as specified by the contents of
  1043. struct tm t to the output record stream pointed to by rp.  The format of
  1044. the time is determined by the time format for the record stream.  See
  1045. section 1.3.16 on how to set the time format.
  1046.  
  1047. If an error occurs, the error indicator for the record stream is set and
  1048. the callback error function is called.
  1049.  
  1050. Returns
  1051.  
  1052. The rputtm function returns no value.
  1053.  
  1054.  
  1055. 1.4.13 The rputui Function
  1056.  
  1057. Synopsis
  1058.  
  1059.      #include <recio.h>
  1060.      void rputui(REC *rp, unsigned int number);
  1061.  
  1062. Description
  1063.  
  1064. The rputui function writes an unsigned integral number to the output record
  1065. stream pointed to by rp.
  1066.  
  1067. If an error occurs, the error indicator for the record stream is set and
  1068. the callback error function is called.
  1069.  
  1070. Returns
  1071.  
  1072. The rputui function returns no value.
  1073.  
  1074.  
  1075. 1.4.14 The rputul Function
  1076.  
  1077. Synopsis
  1078.  
  1079.      #include <recio.h>
  1080.      void rputul(REC *rp, unsigned long number);
  1081.  
  1082. Description
  1083.  
  1084. The rputul function writes an unsigned integral number to the output record
  1085. stream pointed to by rp.
  1086.  
  1087. If an error occurs, the error indicator for the record stream is set and
  1088. the callback error function is called.
  1089.  
  1090. Returns
  1091.  
  1092. The rputul function returns no value.
  1093.  
  1094.  
  1095.  
  1096. 1.5 Column Delimited Field Input Functions
  1097.  
  1098. The column delimited field input functions use column positions to
  1099. determine the start and end of each field.
  1100.  
  1101.  
  1102. 1.5.1 The rcbgeti Function
  1103.  
  1104. Synopsis
  1105.  
  1106.      #include <recio.h>
  1107.      int rcbgeti(REC *rp, size_t begcol, size_t endcol, int base);
  1108.  
  1109. Description
  1110.  
  1111. The rcbgeti function gets one integral number represented by the radix
  1112. determined by the value of base and contained inclusively from column
  1113. begcol to column endcol for the input record stream pointed to by rp.
  1114. Any leading or trailing white space in the field is ignored.
  1115.  
  1116. Base may be zero or in the range of 2 to 36 inclusive.  If the value of
  1117. base is zero, the expected form of the integral number is described by
  1118. section 3.1.3.2 of ANSI X3.159-1989.
  1119.  
  1120. If an error occurs, the error indicator for the record stream is set,
  1121. the callback error function is called, and the function returns zero.
  1122.  
  1123. Returns
  1124.  
  1125. The rcbgeti function returns a signed integer from the input record stream
  1126. pointed to by rp.  If begcol is beyond the end-of-record, if the field is
  1127. empty, or if there is an illegal character in the field, the error indicator
  1128. for the record stream is set, and rcbgeti returns zero.  If the record stream
  1129. is at end-of-file (end-of-file indicator set), rcbgeti returns zero.  If a
  1130. previous error has occurred on the record stream that has not been cleared
  1131. (error indicator set), rcbgeti returns zero.
  1132.  
  1133.  
  1134. 1.5.2 The rcbgetl Function
  1135.  
  1136. Synopsis
  1137.  
  1138.      #include <recio.h>
  1139.      long rcbgetl(REC *rp, size_t begcol, size_t endcol, int base);
  1140.  
  1141. Description
  1142.  
  1143. The rcbgetl function gets one integral number represented by the radix
  1144. determined by the value of base and contained inclusively from column
  1145. begcol to column endcol for the input record stream pointed to by rp.
  1146. Any leading or trailing white space in the field is ignored.
  1147.  
  1148. Base may be zero or in the range of 2 to 36 inclusive.  If the value of
  1149. base is zero, the expected form of the integral number is described by
  1150. section 3.1.3.2 of ANSI X3.159-1989.
  1151.  
  1152. If an error occurs, the error indicator for the record stream is set,
  1153. the callback error function is called, and the function returns zero (0L).
  1154.  
  1155. Returns
  1156.  
  1157. The rcbgetl function returns a signed long from the input record stream
  1158. pointed to by rp.  If begcol is beyond the end-of-record, if the field is
  1159. empty, or if there is an illegal character in the field, the error indicator
  1160. for the record stream is set, and rcbgetl returns zero (0L).  If the record
  1161. stream is at end-of-file (end-of-file indicator set), rcbgetl returns zero
  1162. (0L).  If a previous error has occurred on the record stream that has not been
  1163. cleared (error indicator set), rcbgetl returns zero (0L).
  1164.  
  1165.  
  1166. 1.5.3 The rcbgetui Function
  1167.  
  1168. Synopsis
  1169.  
  1170.      #include <recio.h>
  1171.      unsigned int rcbgetui(REC *rp, size_t begcol, size_t endcol,
  1172.           int base);
  1173.  
  1174. Description
  1175.  
  1176. The rcbgetui function gets one non-negative integral number represented
  1177. by the radix determined by the value of base and contained inclusively
  1178. from column begcol to column endcol for the input record stream pointed
  1179. to by rp.  Any leading or trailing white space in the field is ignored.
  1180.  
  1181. Base may be zero or in the range of 2 to 36 inclusive.  If the value of
  1182. base is zero, the expected form of the integral number is described by
  1183. section 3.1.3.2 of ANSI X3.159-1989.
  1184.  
  1185. If an error occurs, the error indicator for the record stream is set,
  1186. the callback error function is called, and the function returns zero.
  1187.  
  1188. Returns
  1189.  
  1190. The rcbgetui function returns an unsigned integer from the input record
  1191. stream pointed to by rp.  If begcol is beyond the end-of-record, if the
  1192. field is empty, or if there is an illegal character in the field, the
  1193. error indicator for the record stream is set, and rcbgetui returns zero.  If
  1194. the record stream is at end-of-file (end-of-file indicator set), rcbgetui
  1195. returns zero.  If a previous error has occurred on the record stream that has
  1196. not been cleared (error indicator set), rcbgetui returns zero.
  1197.  
  1198.  
  1199. 1.5.4 The rcbgetul Function
  1200.  
  1201. Synopsis
  1202.  
  1203.      #include <recio.h>
  1204.      unsigned long rcbgetul(REC *rp, size_t begcol, size_t endcol,
  1205.           int base);
  1206.  
  1207. Description
  1208.  
  1209. The rcbgetul function gets one non-negative integral number represented
  1210. by the radix determined by the value of base and contained inclusively
  1211. from column begcol to column endcol for the input record stream pointed
  1212. to by rp.  Any leading or trailing white space in the field is ignored.
  1213.  
  1214. Base may be zero or in the range of 2 to 36 inclusive.  If the value of
  1215. base is zero, the expected form of the integral number is described by
  1216. section 3.1.3.2 of ANSI X3.159-1989.
  1217.  
  1218. If an error occurs, the error indicator for the record stream is set,
  1219. the callback error function is called, and the function returns zero (0L).
  1220.  
  1221. Returns
  1222.  
  1223. The rcbgetul function returns an unsigned long from the input record stream
  1224. pointed to by rp.  If begcol is beyond the end-of-record, if the field is
  1225. empty, or if there is an illegal character in the field, the error indicator
  1226. for the record stream is set, and rcbgetul returns zero (0L).  If the record
  1227. stream is at end-of-file (end-of-file indicator set), rcbgetul returns zero
  1228. (0L).  If a previous error has occurred on the record stream that has not been
  1229. cleared (error indicator set), rcbgetul returns zero (0L).
  1230.  
  1231.  
  1232. 1.5.5 The rcgetc Function
  1233.  
  1234. Synopsis
  1235.  
  1236.      #include <recio.h>
  1237.      int rcgetc(REC *rp, size_t col);
  1238.  
  1239. Description
  1240.  
  1241. The rcgetc function obtains from column position col the unsigned char
  1242. converted to an int from the input record stream pointed to by rp.
  1243.  
  1244. If an error occurs, the error indicator for the record stream is set,
  1245. the callback error function is called, and the function returns EOF.
  1246.  
  1247. Returns
  1248.  
  1249. The rcgetc function returns a character from column position col from
  1250. the input record stream pointed to by rp.  If an attempt is made to read
  1251. beyond the end-of-record, the error indicator for the record stream is set,
  1252. and rcgetc returns EOF.  If the record stream is at end-of-file (end-of-file
  1253. indicator set), rcgetc returns EOF.  If a previous error has occurred on the
  1254. record stream that has not been cleared (error indicator set), rcgetc returns
  1255. EOF.
  1256.  
  1257.  
  1258. 1.5.6 The rcgetd Function
  1259.  
  1260. Synopsis
  1261.  
  1262.      #include <recio.h>
  1263.      double rcgetd(REC *rp, size_t begcol, size_t endcol);
  1264.  
  1265. Description
  1266.  
  1267. The rcgetd function gets one floating point number contained inclusively
  1268. from column begcol to column endcol for the input record stream pointed to
  1269. by rp.  Any leading or trailing white space in the field is ignored.
  1270.  
  1271. If an error occurs, the error indicator for the record stream is set,
  1272. the callback error function is called, and the function returns zero.
  1273.  
  1274. Returns
  1275.  
  1276. The rcgetd function returns a double precision floating point number from the
  1277. input record stream pointed to by rp.  If begcol is beyond the end-of-record,
  1278. if the field is empty, or if there is an illegal character in the field, the
  1279. error indicator for the record stream is set, and rcgetd returns zero (0.0).
  1280. If the record stream is at end-of-file (end-of-file indicator set), rcgetd
  1281. returns zero (0.0).  If a previous error has occurred on the record stream
  1282. that has not been cleared (error indicator set), rcgetd returns zero (0.0).
  1283.  
  1284.  
  1285. 1.5.7 The rcgetf Function
  1286.  
  1287. Synopsis
  1288.  
  1289.      #include <recio.h>
  1290.      float rcgetf(REC *rp, size_t begcol, size_t endcol);
  1291.  
  1292. Description
  1293.  
  1294. The rcgetf function gets one floating point number contained inclusively
  1295. from column begcol to column endcol for the input record stream pointed to
  1296. by rp.  Any leading or trailing white space in the field is ignored.
  1297.  
  1298. If an error occurs, the error indicator for the record stream is set,
  1299. the callback error function is called, and the function returns zero.
  1300.  
  1301. Returns
  1302.  
  1303. The rcgetf function returns a single precision floating point number from the
  1304. input record stream pointed to by rp.  If begcol is beyond the end-of-record,
  1305. if the field is empty, or if there is an illegal character in the field, the
  1306. error indicator for the record stream is set, and rcgetf returns zero (0.0).
  1307. If the record stream is at end-of-file (end-of-file indicator set), rcgetf
  1308. returns zero (0.0).  If a previous error has occurred on the record stream
  1309. that has not been cleared (error indicator set), rcgetf returns zero (0.0).
  1310.  
  1311.  
  1312. 1.5.8 The rcgeti Function
  1313.  
  1314. Synopsis
  1315.  
  1316.      #include <recio.h>
  1317.      int rcgeti(REC *rp, size_t begcol, size_t endcol);
  1318.  
  1319. Description
  1320.  
  1321. The rcgeti function gets one integral number contained inclusively from
  1322. column begcol to column endcol for the input record stream pointed to by
  1323. rp.  Any leading or trailing white space in the field is ignored.
  1324.  
  1325. If an error occurs, the error indicator for the record stream is set,
  1326. the callback error function is called, and the function returns zero.
  1327.  
  1328. Returns
  1329.  
  1330. The rcgeti function returns a signed integer from the input record stream
  1331. pointed to by rp.  If begcol is beyond the end-of-record, if the field is
  1332. empty, or if there is an illegal character in the field, the error indicator
  1333. for the record stream is set, and rcgeti returns zero.  If the record stream
  1334. is at end-of-file (end-of-file indicator set), rcgeti returns zero.  If a
  1335. previous error has occurred on the record stream that has not been cleared
  1336. (error indicator set), rcgeti returns zero.
  1337.  
  1338.  
  1339. 1.5.9 The rcgetl Function
  1340.  
  1341. Synopsis
  1342.  
  1343.      #include <recio.h>
  1344.      long rcgetl(REC *rp, size_t begcol, size_t endcol);
  1345.  
  1346. Description
  1347.  
  1348. The rcgetl function gets one integral number contained inclusively from
  1349. column begcol to column endcol for the input record stream pointed to by
  1350. rp.  Any leading or trailing white space in the field is ignored.
  1351.  
  1352. If an error occurs, the error indicator for the record stream is set,
  1353. the callback error function is called, and the function returns zero (0L).
  1354.  
  1355. Returns
  1356.  
  1357. The rcgetl function returns a signed long from the input record stream
  1358. pointed to by rp.  If begcol is beyond the end-of-record, if the field is
  1359. empty, or if there is an illegal character in the field, the error indicator
  1360. for the record stream is set, and rcgetl returns zero (0L).  If the record
  1361. stream is at end-of-file (end-of-file indicator set), rcgetl returns zero
  1362. (0L).  If a previous error has occurred on the record stream that has not
  1363. been cleared (error indicator set), rcgetl returns zero (0L).
  1364.  
  1365.  
  1366. 1.5.10 The rcgets Function
  1367.  
  1368. Synopsis
  1369.  
  1370.      #include <recio.h>
  1371.      char *rcgets(REC *rp, size_t begcol, size_t endcol);
  1372.  
  1373. Description
  1374.  
  1375. The rcgets function gets a string contained inclusively from column
  1376. begcol to column endcol for the input record stream pointed to by
  1377. rp.  The rcgets function does not remove any leading or trailing
  1378. white space, nor does it remove any text delimiter characters.
  1379.  
  1380. If an error occurs, the error indicator for the record stream is set,
  1381. the callback error function is called, and the function returns a pointer
  1382. to an empty string.
  1383.  
  1384. Returns
  1385.  
  1386. The rcgets function returns a pointer to a character array from the input
  1387. record stream pointed to by rp.  If begcol is beyond the end-of-record, the
  1388. error indicator for the record stream is set, and rcgets returns a pointer to
  1389. an empty string.  If the record stream is at end-of-file (eof indicator set),
  1390. rcgets returns a pointer to an empty string.  If a previous error has occurred
  1391. on the record stream that has not been cleared (error indicator set), rcgets
  1392. returns a pointer to an empty string.
  1393.  
  1394.  
  1395. 1.5.11 The rcgett Function
  1396.  
  1397. Synopsis
  1398.  
  1399.      #include <recio.h>
  1400.      time_t rcgett(REC *rp, size_t begcol, size_t endcol);
  1401.  
  1402. Description
  1403.  
  1404. The rcgett function reads a field consisting of one time of type time_t
  1405. contained inclusively from column begcol to column endcol for the input
  1406. record stream pointed to by rp.  Any leading or trailing white space in
  1407. the field is ignored.
  1408.  
  1409. If an error occurs, the error indicator for the record stream is set, the
  1410. callback error function is called, and the function returns (time_t)-1.
  1411.  
  1412. Returns
  1413.  
  1414. The rcgett function returns a time of type time_t.  If an attempt is made to
  1415. read beyond the end-of-record, the error indicator for the record stream is
  1416. set, and rcgett returns (time_t)-1.  If the record stream is at end-of-file
  1417. (end-of-file indicator set), rcgett returns (time_t)-1.  If a previous error
  1418. has occurred on the record stream that has not been cleared (error indicator
  1419. set), rcgett returns (time_t)-1.
  1420.  
  1421.  
  1422. 1.5.12 The rcgettm Function
  1423.  
  1424. Synopsis
  1425.  
  1426.      #include <recio.h>
  1427.      struct tm rcgettm(REC *rp, size_t begcol, size_t endcol);
  1428.  
  1429. Description
  1430.  
  1431. The rcgettm function reads a field consisting of one time of type struct tm
  1432. contained inclusively from column begcol to column endcol for the input
  1433. record stream pointed to by rp.  Any leading or trailing white space in the
  1434. field is ignored.
  1435.  
  1436. If an error occurs, the error indicator for the record stream is set, the
  1437. callback error function is called, and an implementation defined value is
  1438. returned.
  1439.  
  1440. Returns
  1441.  
  1442. The rcgettm function returns a time of type struct tm.  If an attempt is made
  1443. to read beyond the end-of-record, the error indicator for the record stream
  1444. is set, and rcgettm returns an implementation defined value.  If the record
  1445. stream is at end-of-file (end-of-file indicator set), rcgettm returns an
  1446. implementation defined value.  If a previous error has occurred on the
  1447. record stream that has not been cleared (error indicator set), rcgettm
  1448. returns an implementation defined value.
  1449.  
  1450.  
  1451. 1.5.13 The rcgetui Function
  1452.  
  1453. Synopsis
  1454.  
  1455.      #include <recio.h>
  1456.      unsigned int rcgetui(REC *rp, size_t begcol, size_t endcol);
  1457.  
  1458. Description
  1459.  
  1460. The rcgetui function gets one non-negative integral number contained
  1461. inclusively from column begcol to column endcol for the input record
  1462. stream pointed to by rp.  Any leading or trailing white space in the
  1463. field is ignored.
  1464.  
  1465. If an error occurs, the error indicator for the record stream is set,
  1466. the callback error function is called, and the function returns zero.
  1467.  
  1468. Returns
  1469.  
  1470. The rcgetui function returns an unsigned integer from the input record
  1471. stream pointed to by rp.  If begcol is beyond the end-of-record, if the
  1472. field is empty, or if there is an illegal character in the field, the
  1473. error indicator for the record stream is set, and rcgetui returns zero.  If
  1474. the record stream is at end-of-file (end-of-file indicator set), rcgetui
  1475. returns zero.  If a previous error has occurred on the record stream that has
  1476. not been cleared (error indicator set), rcgetui returns zero.
  1477.  
  1478.  
  1479. 1.5.14 The rcgetul Function
  1480.  
  1481. Synopsis
  1482.  
  1483.      #include <recio.h>
  1484.      unsigned long rcgetul(REC *rp, size_t begcol, size_t endcol);
  1485.  
  1486. Description
  1487.  
  1488. The rcgetul function gets one non-negative integral number contained
  1489. inclusively from column begcol to column endcol for the input record
  1490. stream pointed to by rp.  Any leading or trailing white space in the
  1491. field is ignored.
  1492.  
  1493. If an error occurs, the error indicator for the record stream is set,
  1494. the callback error function is called, and the function returns zero (0L).
  1495.  
  1496. Returns
  1497.  
  1498. The rcgetul function returns an unsigned long from the input record stream
  1499. pointed to by rp.  If begcol is beyond the end-of-record, if the field is
  1500. empty, or if there is an illegal character in the field, the error indicator
  1501. for the record stream is set, and rcgetul returns zero (0L).  If the record
  1502. stream is at end-of-file (end-of-file indicator set), rcgetul returns zero
  1503. (0L).  If a previous error has occurred on the record stream that has not
  1504. been cleared (error indicator set), rcgetul returns zero (0L).
  1505.  
  1506.  
  1507.  
  1508. 1.6 Column Delimited Field Output Functions
  1509.  
  1510. The column delimited field output functions automatically place the number,
  1511. string or character between the specified columns in the output.
  1512.  
  1513.  
  1514. 1.6.1 The rcbputi Function
  1515.  
  1516. Synopsis
  1517.  
  1518.      #include <recio.h>
  1519.      void rcbputi(REC *rp, size_t begcol, size_t endcol, int base,
  1520.                   int number);
  1521.  
  1522. Description
  1523.  
  1524. The rcbputi function writes an integral number in the radix base from column
  1525. begcol to column endcol of the output record stream pointed to by rp.  Base
  1526. may be between 2 to 36.
  1527.  
  1528. If the number is too large to fit between the columns, asterisks are printed
  1529. between the columns and the callback warning function is called.  The
  1530. warning indicator for the record stream is set.
  1531.  
  1532. If an error occurs, the error indicator for the record stream is set and
  1533. the callback error function is called.
  1534.  
  1535. Returns
  1536.  
  1537. The rcbputi function returns no value.
  1538.  
  1539.  
  1540. 1.6.2 The rcbputl Function
  1541.  
  1542. Synopsis
  1543.  
  1544.      #include <recio.h>
  1545.      void rcbputl(REC *rp, size_t begcol, size_t endcol, int base,
  1546.                   long number);
  1547.  
  1548. Description
  1549.  
  1550. The rcbputl function writes an integral number in the radix base from column
  1551. begcol to column endcol of the output record stream pointed to by rp.  Base
  1552. may be between 2 to 36.
  1553.  
  1554. If the number is too large to fit between the columns, asterisks are printed
  1555. between the columns and the callback warning function is called.  The
  1556. warning indicator for the record stream is set.
  1557.  
  1558. If an error occurs, the error indicator for the record stream is set and
  1559. the callback error function is called.
  1560.  
  1561. Returns
  1562.  
  1563. The rcbputl function returns no value.
  1564.  
  1565.  
  1566. 1.6.3 The rcbputui Function
  1567.  
  1568. Synopsis
  1569.  
  1570.      #include <recio.h>
  1571.      void rcbputui(REC *rp, size_t begcol, size_t endcol, int base,
  1572.                    unsigned int number);
  1573.  
  1574. Description
  1575.  
  1576. The rcbputui function writes an unsigned integral number in the radix base
  1577. from column begcol to column endcol of the output record stream pointed to
  1578. by rp.  Base may be between 2 to 36.
  1579.  
  1580. If the number is too large to fit between the columns, asterisks are printed
  1581. between the columns and the callback warning function is called.  The
  1582. warning indicator for the record stream is set.
  1583.  
  1584. If an error occurs, the error indicator for the record stream is set and
  1585. the callback error function is called.
  1586.  
  1587. Returns
  1588.  
  1589. The rcbputui function returns no value.
  1590.  
  1591.  
  1592. 1.6.4 The rcbputul Function
  1593.  
  1594. Synopsis
  1595.  
  1596.      #include <recio.h>
  1597.      void rcbputul(REC *rp, size_t begcol, size_t endcol, int base,
  1598.                    unsigned long number);
  1599.  
  1600. Description
  1601.  
  1602. The rcbputul function writes an unsigned integral number in the radix base
  1603. from column begcol to column endcol of the output record stream pointed to
  1604. by rp.  Base may be between 2 to 36.
  1605.  
  1606. If the number is too large to fit between the columns, asterisks are printed
  1607. between the columns and the callback warning function is called.  The
  1608. warning indicator for the record stream is set.
  1609.  
  1610. If an error occurs, the error indicator for the record stream is set and
  1611. the callback error function is called.
  1612.  
  1613. Returns
  1614.  
  1615. The rcbputul function returns no value.
  1616.  
  1617.  
  1618. 1.6.5 The rcputc Function
  1619.  
  1620. Synopsis
  1621.  
  1622.      #include <recio.h>
  1623.      void rcputc(REC *rp, size_t col, int ch);
  1624.  
  1625. Description
  1626.  
  1627. The rcputc function writes a character ch at column col of the output record
  1628. stream pointed to by rp.
  1629.  
  1630. If an error occurs, the error indicator for the record stream is set and
  1631. the callback error function is called.
  1632.  
  1633. Returns
  1634.  
  1635. The rcputc function returns no value.
  1636.  
  1637.  
  1638. 1.6.6 The rcputd Function
  1639.  
  1640. Synopsis
  1641.  
  1642.      #include <recio.h>
  1643.      void rcputd(REC *rp, size_t begcol, size_t endcol, double number);
  1644.  
  1645. Description
  1646.  
  1647. The rcputd function writes a floating point number from column begcol to
  1648. column endcol of the output record stream pointed to by rp.
  1649.  
  1650. If the number is too large to fit between the columns, asterisks are printed
  1651. between the columns and the callback warning function is called.  The
  1652. warning indicator for the record stream is set.
  1653.  
  1654. If an error occurs, the error indicator for the record stream is set and
  1655. the callback error function is called.
  1656.  
  1657. Returns
  1658.  
  1659. The rcputd function returns no value.
  1660.  
  1661.  
  1662. 1.6.7 The rcputf Function
  1663.  
  1664. Synopsis
  1665.  
  1666.      #include <recio.h>
  1667.      void rcputf(REC *rp, size_t begcol, size_t endcol, float number);
  1668.  
  1669. Description
  1670.  
  1671. The rcputf function writes a floating point number from column begcol to
  1672. column endcol of the output record stream pointed to by rp.
  1673.  
  1674. If the number is too large to fit between the columns, asterisks are printed
  1675. between the columns and the callback warning function is called.  The
  1676. warning indicator for the record stream is set.
  1677.  
  1678. If an error occurs, the error indicator for the record stream is set and
  1679. the callback error function is called.
  1680.  
  1681. Returns
  1682.  
  1683. The rcputf function returns no value.
  1684.  
  1685.  
  1686. 1.6.8 The rcputi Function
  1687.  
  1688. Synopsis
  1689.  
  1690.      #include <recio.h>
  1691.      void rcputi(REC *rp, size_t begcol, size_t endcol, int number);
  1692.  
  1693. Description
  1694.  
  1695. The rcputi function writes an integral number from column begcol to column
  1696. endcol of the output record stream pointed to by rp.
  1697.  
  1698. If the number is too large to fit between the columns, asterisks are printed
  1699. between the columns and the callback warning function is called.  The
  1700. warning indicator for the record stream is set.
  1701.  
  1702. If an error occurs, the error indicator for the record stream is set and
  1703. the callback error function is called.
  1704.  
  1705. Returns
  1706.  
  1707. The rcputi function returns no value.
  1708.  
  1709.  
  1710. 1.6.9 The rcputl Function
  1711.  
  1712. Synopsis
  1713.  
  1714.      #include <recio.h>
  1715.      void rcputl(REC *rp, size_t begcol, size_t endcol, long number);
  1716.  
  1717. Description
  1718.  
  1719. The rcputl function writes an integral number from column begcol to column
  1720. endcol of the output record stream pointed to by rp.
  1721.  
  1722. If the number is too large to fit between the columns, asterisks are printed
  1723. between the columns and the callback warning function is called.  The
  1724. warning indicator for the record stream is set.
  1725.  
  1726. If an error occurs, the error indicator for the record stream is set and
  1727. the callback error function is called.
  1728.  
  1729. Returns
  1730.  
  1731. The rcputl function returns no value.
  1732.  
  1733.  
  1734. 1.6.10 The rcputs Function
  1735.  
  1736. Synopsis
  1737.  
  1738.      #include <recio.h>
  1739.      void rcputs(REC *rp, size_t begcol, size_t endcol, char *string);
  1740.  
  1741. Description
  1742.  
  1743. The rcputs function writes a string of characters from column begcol to
  1744. column endcol of the output record stream pointed to by rp.
  1745.  
  1746. If the string is too large to fit between the columns, a truncated string
  1747. is output and the callback warning function is called.  The warning
  1748. indicator for the record stream is set.
  1749.  
  1750. If an error occurs, the error indicator for the record stream is set and
  1751. the callback error function is called.
  1752.  
  1753. Returns
  1754.  
  1755. The rcputs function returns no value.
  1756.  
  1757.  
  1758. 1.6.11 The rcputt Function
  1759.  
  1760. Synopsis
  1761.  
  1762.      #include <recio.h>
  1763.      void rcputt(REC *rp, size_t begcol, size_t endcol, time_t time);
  1764.  
  1765. Description
  1766.  
  1767. The rcputt function writes the time from column begcol to column endcol
  1768. of the output record stream pointed to by rp.  The format of the time is
  1769. determined by the time format for the record stream.  See section 1.3.16
  1770. on how to set the time format.
  1771.  
  1772. If the time is too large to fit between the columns, asterisks are printed
  1773. between the columns and the callback warning function is called.  The
  1774. warning indicator for the record stream is set.
  1775.  
  1776. If an error occurs, the error indicator for the record stream is set and
  1777. the callback error function is called.
  1778.  
  1779. Returns
  1780.  
  1781. The rcputt function returns no value.
  1782.  
  1783.  
  1784. 1.6.12 The rcputtm Function
  1785.  
  1786. Synopsis
  1787.  
  1788.      #include <recio.h>
  1789.      void rcputtm(REC *rp, size_t begcol, size_t endcol, struct tm t);
  1790.  
  1791. Description
  1792.  
  1793. The rcputtm function writes out the time as specified by the contents of
  1794. struct tm t from column begcol to column endcol of the output record
  1795. stream pointed to by rp.  The format of the time is determined by the
  1796. time format for the record stream.  See section 1.3.16 on how to set the
  1797. time format.
  1798.  
  1799. If the time is too large to fit between the columns, asterisks are printed
  1800. between the columns and the callback warning function is called.  The
  1801. warning indicator for the record stream is set.
  1802.  
  1803. If an error occurs, the error indicator for the record stream is set and
  1804. the callback error function is called.
  1805.  
  1806. Returns
  1807.  
  1808. The rcputtm function returns no value.
  1809.  
  1810.  
  1811. 1.6.13 The rcputui Function
  1812.  
  1813. Synopsis
  1814.  
  1815.      #include <recio.h>
  1816.      void rcputui(REC *rp, size_t begcol, size_t endcol,
  1817.                   unsigned int number);
  1818.  
  1819. Description
  1820.  
  1821. The rcputui function writes an unsigned integral number from column begcol to
  1822. column endcol of the output record stream pointed to by rp.
  1823.  
  1824. If the number is too large to fit between the columns, asterisks are printed
  1825. between the columns and the callback warning function is called.  The
  1826. warning indicator for the record stream is set.
  1827.  
  1828. If an error occurs, the error indicator for the record stream is set and
  1829. the callback error function is called.
  1830.  
  1831. Returns
  1832.  
  1833. The rcputui function returns no value.
  1834.  
  1835.  
  1836. 1.6.14 The rcputul Function
  1837.  
  1838. Synopsis
  1839.  
  1840.      #include <recio.h>
  1841.      void rcputul(REC *rp, size_t begcol, size_t endcol,
  1842.                   unsigned long number);
  1843.  
  1844. Description
  1845.  
  1846. The rcputul function writes an unsigned integral number from column begcol to
  1847. column endcol of the output record stream pointed to by rp.
  1848.  
  1849. If the number is too large to fit between the columns, asterisks are printed
  1850. between the columns and the callback warning function is called.  The
  1851. warning indicator for the record stream is set.
  1852.  
  1853. If an error occurs, the error indicator for the record stream is set and
  1854. the callback error function is called.
  1855.  
  1856. Returns
  1857.  
  1858. The rcputul function returns no value.
  1859.  
  1860.  
  1861.  
  1862. 1.7 Current Position Functions
  1863.  
  1864. 1.7.1 The rbegcolno Function
  1865.  
  1866. Synopsis
  1867.  
  1868.      #include <recio.h>
  1869.      int rbegcolno(REC *rp);
  1870.  
  1871. Description
  1872.  
  1873. The rbegcolno function gets the current setting of the first column number
  1874. in the record for the record stream pointed to by rp.
  1875.  
  1876. Returns
  1877.  
  1878. The rbegcolno function returns 0 if column numbering starts with zero or
  1879. 1 if column numbering starts with one.
  1880.  
  1881.  
  1882. 1.7.2 The rcolno Function
  1883.  
  1884. Synopsis
  1885.  
  1886.      #include <recio.h>
  1887.      size_t rcolno(REC *rp);
  1888.  
  1889. Description
  1890.  
  1891. The rcolno function gets the current column number of the current record
  1892. for the record stream pointed to by rp.
  1893.  
  1894. Returns
  1895.  
  1896. The rcolno function returns the current column number of the current record
  1897. for the record stream pointed to by rp.  The rcolno function returns zero
  1898. prior to the reading of the first record.
  1899.  
  1900.  
  1901. 1.7.3 The rflds Function
  1902.  
  1903. Synopsis
  1904.  
  1905.      #include <recio.h>
  1906.      char *rflds(REC *rp);
  1907.  
  1908. Description
  1909.  
  1910. The rflds function gets a pointer to the field buffer associated with
  1911. the record stream pointed to by rp.  The last field read from the current
  1912. record is stored in the field buffer.  The field is terminated by a
  1913. null character.
  1914.  
  1915. Returns
  1916.  
  1917. The rflds function returns a pointer to the field buffer associated with
  1918. the record stream pointed to by rp.
  1919.  
  1920.  
  1921. 1.7.4 The rfldno Function
  1922.  
  1923. Synopsis
  1924.  
  1925.      #include <recio.h>
  1926.      size_t rfldno(REC *rp);
  1927.  
  1928. Description
  1929.  
  1930. The rfldno function gets the number of fields that have been read from
  1931. the current record for the record stream pointed to by rp.
  1932.  
  1933. Returns
  1934.  
  1935. The rfldno function returns the number of fields that have been read from
  1936. the current record for the record stream pointed to by rp.
  1937.  
  1938.  
  1939. 1.7.5 The rgetfldpos Function
  1940.  
  1941. Synopsis
  1942.  
  1943.      #include <recio.h>
  1944.      void rgetfldpos(REC *rp, rpos_t &pos)
  1945.  
  1946. Description
  1947.  
  1948. The rgetfldpos function stores the current value of the field position
  1949. indicator of the current record for the input stream pointed to by rp
  1950. into the object pointed to by pos.  The value stored contains unspecified
  1951. information usable by the rsetfldpos function to set the field position of
  1952. the current record to the same position as when the rgetfldpos function
  1953. was called.
  1954.  
  1955. If an error occurs, the error indicator for the record stream is set, and
  1956. the callback error function is called.
  1957.  
  1958. Returns
  1959.  
  1960. The rgetfldpos function returns no value.
  1961.  
  1962.  
  1963. 1.7.6 The rnames Function
  1964.  
  1965. Synopsis
  1966.  
  1967.      #include <recio.h>
  1968.      char *rnames(REC *rp);
  1969.  
  1970. Description
  1971.  
  1972. The rnames function gets a pointer to the name of the file associated
  1973. with the record stream pointed to by rp.
  1974.  
  1975. Returns
  1976.  
  1977. The rnames function returns a pointer to the name of the file associated
  1978. with the record stream pointed to by rp.
  1979.  
  1980.  
  1981. 1.7.7 The rgetrec Function
  1982.  
  1983. Synopsis
  1984.  
  1985.      #include <recio.h>
  1986.      char *rgetrec(REC *rp);
  1987.  
  1988. Description
  1989.  
  1990. The rgetrec function gets the next record from the record stream pointed
  1991. to by rp.  The rgetrec function increments the record number, clears the
  1992. field number to zero, resets the column number to rbegcolno(), and returns
  1993. a pointer to the record buffer.
  1994.  
  1995. Record numbering starts at one (1L).  Before the first record in a record
  1996. stream is read into the record buffer, the record number is zero.
  1997.  
  1998. Field numbering starts at one (1).  Before the first field in a record is
  1999. read into the field buffer, the field number is zero.
  2000.  
  2001. Column numbering starts at either zero or one, depending on the setting of
  2002. the rsetbegcolno function.  Column numbering defaults to zero.
  2003.  
  2004. If an error occurs, the error indicator for the record stream is set,
  2005. the callback error function is called, and the rgetrec
  2006. function returns a null pointer.
  2007.  
  2008. If the end-of-file is reached, the end-of-file indicator for the record
  2009. stream is set and the rgetrec function returns a null pointer.
  2010.  
  2011. Returns
  2012.  
  2013. The rgetrec function returns a pointer to the record buffer if the next
  2014. record was successfully read.  A null pointer is returned on either
  2015. error or end-of-file.
  2016.  
  2017.  
  2018. 1.7.8 The rnumfld Function
  2019.  
  2020. Synopsis
  2021.  
  2022.      #include <recio.h>
  2023.      unsigned int rnumfld(REC *rp);
  2024.  
  2025. Description
  2026.  
  2027. The rnumfld function gets the number of fields in the current record for
  2028. the input record stream pointed to by rp.
  2029.  
  2030. If an error occurs, the error indicator for the record stream is set, and
  2031. the callback error function is called.
  2032.  
  2033. Returns
  2034.  
  2035. The rnumfld function returns the number of fields in the current record.
  2036.  
  2037.  
  2038. 1.7.9 The rputrec Function
  2039.  
  2040. Synopsis
  2041.  
  2042.      #include <recio.h>
  2043.      void rputrec(REC *rp);
  2044.  
  2045. Description
  2046.  
  2047. The rputrec function writes the end-of-record newline character to the output
  2048. record stream pointed to by rp.  The rputrec function increments the record
  2049. number, clears the field number to zero, resets the column number to either
  2050. zero or one, depending on the setting of the rsetbegcolno function.
  2051.  
  2052. Record numbering starts at one (1L).  Before the first record in a record
  2053. stream is written, the record number is zero.
  2054.  
  2055. Field numbering starts at one (1).  Before the first field in a record is
  2056. written, the field number is zero.
  2057.  
  2058. Column numbering starts at either zero or one, depending on the setting of
  2059. the rsetbegcolno function.  Column numbering defaults to zero.
  2060.  
  2061. If an error occurs, the error indicator for the record stream is set, and
  2062. the callback error function is called.
  2063.  
  2064. Returns
  2065.  
  2066. The rputrec function returns no value.
  2067.  
  2068.  
  2069. 1.7.10 The rrecs Function
  2070.  
  2071. Synopsis
  2072.  
  2073.      #include <recio.h>
  2074.      char *rrecs(REC *rp);
  2075.  
  2076. Description
  2077.  
  2078. The rrecs function gets a pointer to the record buffer associated with
  2079. the record stream pointed to by rp.  The current record is stored in the
  2080. record buffer.  The record is terminated by a null character.
  2081.  
  2082. Returns
  2083.  
  2084. The rrecs function returns a pointer to the record buffer associated with
  2085. the record stream pointed to by rp.
  2086.  
  2087.  
  2088. 1.7.11 The rrecno Function
  2089.  
  2090. Synopsis
  2091.  
  2092.      #include <recio.h>
  2093.      long rrecno(REC *rp);
  2094.  
  2095. Description
  2096.  
  2097. The rrecno function gets the number of records that have been read from
  2098. the record stream pointed to by rp.
  2099.  
  2100. Returns
  2101.  
  2102. The rrecno function returns the number of records that have been read from
  2103. the record stream pointed to by rp.
  2104.  
  2105.  
  2106. 1.7.12 The rresetrec Function
  2107.  
  2108. Synopsis
  2109.  
  2110.     #include <recio.h>
  2111.     void rresetrec(REC *rp);
  2112.  
  2113. Description
  2114.  
  2115. The rresetrec function resets the internals of the input stream pointed
  2116. to by rp such that the next use of a rget field function reads from the
  2117. beginning of the record buffer.  It has no effect on an output stream.
  2118.  
  2119. Returns
  2120.  
  2121. The rresetrec function returns no value.
  2122.  
  2123.  
  2124. 1.7.13 The rsetbegcolno Function
  2125.  
  2126. Synopsis
  2127.  
  2128.      #include <recio.h>
  2129.      void rsetbegcolno(REC *rp, int colno);
  2130.  
  2131. Description
  2132.  
  2133. The rsetbegcolno function sets the first column number colno for the record
  2134. stream pointed to by rp.  Column numbering can start at either 0 or 1.
  2135.  
  2136. If an error occurs, the error indicator for the record stream is set and
  2137. the callback error function is called.
  2138.  
  2139. Returns
  2140.  
  2141. The rsetbegcolno function returns no value.
  2142.  
  2143.  
  2144. 1.7.14 The rsetfldpos Function
  2145.  
  2146. Synopsis
  2147.  
  2148.     #include <recio.h>
  2149.     void rsetfldpos(REC *rp, rpos_t &pos);
  2150.  
  2151. Description
  2152.  
  2153. The rsetfldpos function sets the field position indicator of the current
  2154. record of the input stream pointed to by rp according to the value of the
  2155. object pointed to by pos, which is a value obtained from an earlier call
  2156. to the rgetfldpos function on the same stream.  If the record has changed
  2157. since the earlier call to the rgetfldpos function, the behavior of this
  2158. function is implementation dependent.
  2159.  
  2160. If an error occurs, the error indicator for the record stream is set and
  2161. the callback error function is called.
  2162.  
  2163. Returns
  2164.  
  2165. The rsetfldpos function returns no value.
  2166.  
  2167.  
  2168. 1.7.15 The rsetfldstr Function
  2169.  
  2170. Synopsis
  2171.  
  2172.      #include <recio.h>
  2173.      void rsetfldstr(REC *rp, char *s);
  2174.  
  2175. Description
  2176.  
  2177. The rsetfldstr function copies the string s into the field buffer of the
  2178. record stream pointed to by rp.  Any existing string in the field buffer
  2179. is overwritten.  The field buffer size is increased, if necessary, to
  2180. accommodate the string.
  2181.  
  2182. A side effect of using the rsetfldstr function is that the error and
  2183. end-of-file indicators for the record stream are cleared (provided
  2184. rsetfldstr does not create an error).
  2185.  
  2186. If an error occurs, the error indicator for the record stream is set and
  2187. the callback error function is called.
  2188.  
  2189. Returns
  2190.  
  2191. The rsetfldstr function returns no value.
  2192.  
  2193.  
  2194. 1.7.16 The rsetrecstr Function
  2195.  
  2196. Synopsis
  2197.  
  2198.      #include <recio.h>
  2199.      void rsetrecstr(REC *rp, char *s);
  2200.  
  2201. Description
  2202.  
  2203. The rsetrecstr function copies the string s into the record buffer of the
  2204. input record stream pointed to by rp.  Any existing string in the record
  2205. buffer is overwritten.  The record buffer size is increased, if necessary,
  2206. to accommodate the string.  It has no effect on an output stream.
  2207.  
  2208. A side effect of using the rsetrecstr function is that the error and
  2209. end-of-file indicators for the record stream are cleared (provided
  2210. rsetrecstr does not create an error).
  2211.  
  2212. If an error occurs, the error indicator for the record stream is set and
  2213. the callback error function is called.
  2214.  
  2215. Returns
  2216.  
  2217. The rsetrecstr function returns no value.
  2218.  
  2219.  
  2220.  
  2221. 1.8 Error Functions
  2222.  
  2223. 1.8.1 The errno Macro
  2224.  
  2225. Synopsis
  2226.  
  2227.      #include <errno.h>
  2228.  
  2229. Description
  2230.  
  2231. The errno macro "expands to a modifiable lvalue that has type int, the
  2232. value of which is set to a positive error number by several library
  2233. functions." -Section 4.1.3 of ANSI X3.159-1989.
  2234.  
  2235.  
  2236. 1.8.2 The rclearerr Function
  2237.  
  2238. Synopsis
  2239.  
  2240.      #include <recio.h>
  2241.      void rclearerr(REC *rp);
  2242.  
  2243. Description
  2244.  
  2245. The rclearerr function clears the end-of-file and error indicators for
  2246. the record stream pointed to by rp.
  2247.  
  2248. Returns
  2249.  
  2250. The rclearerr function returns no value.
  2251.  
  2252.  
  2253. 1.8.3 The rcxtno Function
  2254.  
  2255. Synopsis
  2256.  
  2257.      #include <recio.h>
  2258.      int rcxtno(REC *rp);
  2259.  
  2260. Description
  2261.  
  2262. The rcxtno function gets the context number from the record stream pointed
  2263. to by rp.  Context numbers can be assigned to a record stream using the
  2264. rsetcxtno function.  A zero context number indicates that the context
  2265. number has not been assigned.  The recin, recout, recerr, and recprn streams
  2266. return the macro values of RECIN, RECOUT, RECERR, and RECPRN respectively.
  2267.  
  2268. Returns
  2269.  
  2270. The rcxtno function returns the context number from the record stream pointed
  2271. to by rp.
  2272.  
  2273.  
  2274. 1.8.4 The reof Function
  2275.  
  2276. Synopsis
  2277.  
  2278.      #include <recio.h>
  2279.      int reof(REC *rp);
  2280.  
  2281. Description
  2282.  
  2283. The reof function tests the end-of-file indicator for the record stream
  2284. pointed to by rp.
  2285.  
  2286. Returns
  2287.  
  2288. The reof function returns nonzero if and only if the end-of-file indicator
  2289. is set for the record stream pointed to by rp.
  2290.  
  2291.  
  2292. 1.8.5 The rerror Function
  2293.  
  2294. Synopsis
  2295.  
  2296.      #include <recio.h>
  2297.      int rerror(REC *rp);
  2298.  
  2299. Description
  2300.  
  2301. The rerror function tests the error indicator for the record stream
  2302. pointed to by rp.
  2303.  
  2304. Returns
  2305.  
  2306. The rerror function returns nonzero if and only if the error indicator
  2307. is set for the record stream pointed to by rp.
  2308.  
  2309.  
  2310. 1.8.6 The rerrstr Function
  2311.  
  2312. Synopsis
  2313.  
  2314.      #include <recio.h>
  2315.      char *rerrstr(REC *rp);
  2316.  
  2317. Description
  2318.  
  2319. The rerrstr function gets the error message for the record stream pointed
  2320. to by rp.  The text of the error message is implementation dependent.
  2321.  
  2322. Returns
  2323.  
  2324. The rerrstr function returns a pointer to a string containing an error
  2325. message.
  2326.  
  2327.  
  2328. 1.8.7 The risvalid Function
  2329.  
  2330. Synopsis
  2331.  
  2332.      #include <recio.h>
  2333.      int risvalid(REC *rp);
  2334.  
  2335. Description
  2336.  
  2337. The risvalid function tests if rp is a valid pointer to a record stream.
  2338.  
  2339. Returns
  2340.  
  2341. The risvalid function returns a nonzero value if and only if rp is a
  2342. valid pointer to an open record stream.
  2343.  
  2344.  
  2345. 1.8.8 The rsetcxtno Function
  2346.  
  2347. Synopsis
  2348.  
  2349.      #include <recio.h>
  2350.      void rsetcxtno(REC *rp, int cxtno);
  2351.  
  2352. Description
  2353.  
  2354. The rsetcxtno function sets the context number cxtno on the record stream
  2355. pointed to by rp.  Assigning a context number allows a file format to be more
  2356. easily identified in the callback error function.  Negative context numbers
  2357. are reserved; a zero context number indicates an that the context has not
  2358. been assigned.  A macro values RECIN, RECOUT, RECERR, and RECPRN are
  2359. preassigned to the recin, recout, recerr, and recprn streams respectively.
  2360.  
  2361.  
  2362. Returns
  2363.  
  2364. The rsetcxtno returns no value.
  2365.  
  2366.  
  2367. 1.8.9 The rseterr Function
  2368.  
  2369. Synopsis
  2370.  
  2371.      #include <recio.h>
  2372.      int rseterr(REC *rp, int errnum);
  2373.  
  2374. Description
  2375.  
  2376. The rseterr function sets the global error number errno to the value of
  2377. errnum if the record stream pointed to by rp is null.  If rp points to
  2378. a valid record stream, the rseterr function sets the error indicator on
  2379. the record stream.  The callback error function is called.  If the record
  2380. stream error indicator is already set on entry to the rseterr function,
  2381. the rseterr function does nothing.
  2382.  
  2383. Returns
  2384.  
  2385. The rseterr function returns the error number.  If the callback error
  2386. function corrects the error and clears the error number, the function
  2387. returns zero.
  2388.  
  2389.  
  2390. 1.8.10 The rseterrfn Function
  2391.  
  2392. Synopsis
  2393.  
  2394.      #include <recio.h>
  2395.      void rseterrfn(void(*rerrfn)(REC *rp));
  2396.  
  2397. Description
  2398.  
  2399. The rseterrfn function registers the callback error function rerrfn for the
  2400. record stream pointed to by rp.
  2401.  
  2402. Returns
  2403.  
  2404. The rseterrfn function returns no value.  The callback error function rerrfn
  2405. returns no value.
  2406.  
  2407.  
  2408. 1.8.11 The rstrerror Function
  2409.  
  2410. Synopsis
  2411.  
  2412.      #include <recio.h>
  2413.      char *rstrerror(int errnum);
  2414.  
  2415. Description
  2416.  
  2417. The rstrerror function maps the error number in errnum to an error
  2418. message string.  The error number and the text of the error message
  2419. are implementation dependent.  (To map errno to an error string, use
  2420. the strerror function.)
  2421.  
  2422. Returns
  2423.  
  2424. The rstrerror function returns a pointer to a string containing an
  2425. error message.
  2426.  
  2427.  
  2428.  
  2429. 1.9 Warning Functions
  2430.  
  2431. 1.9.1 The rclearwarn Function
  2432.  
  2433. Synopsis
  2434.  
  2435.      #include <recio.h>
  2436.      void rclearwarn(REC *rp);
  2437.  
  2438. Description
  2439.  
  2440. The rclearwarn function clears the warning indicator for the record stream
  2441. pointed to by rp.
  2442.  
  2443. Returns
  2444.  
  2445. The rclearwarn function returns no value.
  2446.  
  2447.  
  2448. 1.9.2 The rsetwarn Function
  2449.  
  2450. Synopsis
  2451.  
  2452.      #include <recio.h>
  2453.      int rsetwarn(REC *rp, int warnum);
  2454.  
  2455. Description
  2456.  
  2457. The rsetwarn function sets the warning indicator on the record stream 
  2458. pointed to by rp.  The callback warning function is called (if registered).
  2459.  
  2460. Returns
  2461.  
  2462. The rsetwarn function returns the warning number.  If the callback warning
  2463. function modifies the warning number, the function returns the modified
  2464. warning number.
  2465.  
  2466.  
  2467. 1.9.3 The rsetwarnfn Function
  2468.  
  2469. Synopsis
  2470.  
  2471.      #include <recio.h>
  2472.      void rsetwarnfn(void(*rwarnfn)(REC *rp));
  2473.  
  2474. Description
  2475.  
  2476. The rsetwarnfn function registers the callback warning function rwarnfn for
  2477. the record stream pointed to by rp.
  2478.  
  2479. Returns
  2480.  
  2481. The rsetwarnfn function returns no value.  The callback warning function
  2482. rwarnfn returns no value.
  2483.  
  2484.  
  2485. 1.9.4 The rstrwarning Function
  2486.  
  2487. Synopsis
  2488.  
  2489.      #include <recio.h>
  2490.      char *rstrwarning(int warnum);
  2491.  
  2492. Description
  2493.  
  2494. The rstrwarning function maps the warning number warnum to an warning
  2495. message string.  The warning number and the text of the warning message
  2496. are implementation dependent.
  2497.  
  2498. Returns
  2499.  
  2500. The rstrwarning function returns a pointer to a string containing an
  2501. warning message.
  2502.  
  2503.  
  2504. 1.9.5 The rwarning Function
  2505.  
  2506. Synopsis
  2507.  
  2508.      #include <recio.h>
  2509.      int rwarning(REC *rp);
  2510.  
  2511. Description
  2512.  
  2513. The rwarning function tests the warning indicator for the record stream
  2514. pointed to by rp.
  2515.  
  2516. Returns
  2517.  
  2518. The rwarning function returns nonzero if and only if the warning indicator
  2519. is set for the record stream pointed to by rp.
  2520.  
  2521.  
  2522. 1.9.6 The rwarnstr Function
  2523.  
  2524. Synopsis
  2525.  
  2526.      #include <recio.h>
  2527.      char *rwarnstr(REC *rp);
  2528.  
  2529. Description
  2530.  
  2531. The rwarnstr function gets the warning message for the record stream pointed
  2532. to by rp.  The text of the warning message is implementation dependent.
  2533.  
  2534. Returns
  2535.  
  2536. The rwarnstr function returns a pointer to a string containing an warning
  2537. message.
  2538.  
  2539.  
  2540.  
  2541. 2.0 PORTABILITY ISSUES
  2542.  
  2543. The first six characters of this function are common to another function.
  2544. Ref 3.1.2 of ANSI X3.159-1989.  (1.2.1, 1.2.2, 1.2.4, 1.3.3, 1.3.4, 1.3.15,
  2545. 1.5.1-1.5.4, 1.5.11-1.5.14, 1.6.1-1.6.4, 1.6.11-1.6.14, 1.7.15, 1.8.9,
  2546. 1.8.10, 1.9.2, 1.9.3)
  2547.  
  2548. References are not implemented in ANSI X3.159-1989, but are part of C++.
  2549. They can be reasonably simulated in C (for functions that don't have a
  2550. variable number of arguments) by use of a macro that inserts the & into the
  2551. call.  (1.7.5, 1.7.14)
  2552.  
  2553.  
  2554.  
  2555. 3.0 REFERENCES
  2556.  
  2557. 1. ANSI X3.159-1989.  American National Standard for Information Systems -
  2558.    Programming Language - C.  American National Standards Institute,
  2559.    11 West 42nd Street, New York, NY 10036, 1990.
  2560.  
  2561.  
  2562. 4.0 INDEX
  2563.  
  2564. errno macro ............ 1.8.1
  2565. FLDBUFSIZ macro ........ 1.1.3, 1.2.4
  2566. rbegcolno function ..... 1.7.1, 1.7.7
  2567. rbgeti function ........ 1.3.1
  2568. rbgetl function ........ 1.3.2
  2569. rbgetui function ....... 1.3.3
  2570. rbgetul function ....... 1.3.4
  2571. rbputi function ........ 1.4.1
  2572. rbputl function ........ 1.4.2
  2573. rbputui function ....... 1.4.3
  2574. rbputul function ....... 1.4.4
  2575. rcbgeti function ....... 1.5.1
  2576. rcbgetl function ....... 1.5.2
  2577. rcbgetui function ...... 1.5.3
  2578. rcbgetul function ...... 1.5.4
  2579. rcbputi function ....... 1.6.1
  2580. rcbputl function ....... 1.6.2
  2581. rcbputui function ...... 1.6.3
  2582. rcbputul function ...... 1.6.4
  2583. rcgetc function ........ 1.5.5
  2584. rcgetd function ........ 1.5.6
  2585. rcgetf function ........ 1.5.7
  2586. rcgeti function ........ 1.5.8
  2587. rcgetl function ........ 1.5.9
  2588. rcgets function ........ 1.5.10
  2589. rcgett function ........ 1.5.11
  2590. rcgettm function ....... 1.5.12
  2591. rcgetui function ....... 1.5.13
  2592. rcgetul function ....... 1.5.14
  2593. rclearerr function ..... 1.8.2
  2594. rclearwarn function .... 1.9.1
  2595. rclose function ........ 1.2.1
  2596. rcloseall function ..... 1.2.2
  2597. rcolno function ........ 1.7.2
  2598. rcputc function ........ 1.6.5
  2599. rcputd function ........ 1.6.6
  2600. rcputf function ........ 1.6.7
  2601. rcputi function ........ 1.6.8
  2602. rcputl function ........ 1.6.9
  2603. rcputs function ........ 1.6.10
  2604. rcputt function ........ 1.6.11
  2605. rcputtm function ....... 1.6.12
  2606. rcputui function ....... 1.6.13
  2607. rcputul function ....... 1.6.14
  2608. rcxtno function ........ 1.8.3
  2609. REC object ............. 1.1.2
  2610. recin expression ....... 1.1.4
  2611. RECBUFSIZ macro ........ 1.1.3, 1.2.5
  2612. RECFLDCH macro ......... 1.1.3, 1.3.15
  2613. RECTXTCH macro ......... 1.1.3, 1.3.17
  2614. reof function .......... 1.8.4
  2615. rerror function ........ 1.8.5
  2616. rerrstr function ....... 1.8.6
  2617. rflds function ......... 1.7.3
  2618. rfldno function ........ 1.7.4
  2619. rgetc function ......... 1.3.5
  2620. rgetd function ......... 1.3.6
  2621. rgetf function ......... 1.3.7
  2622. rgetfldpos function .... 1.7.5
  2623. rgeti function ......... 1.3.8
  2624. rgetl function ......... 1.3.9
  2625. rgetrec function ....... 1.7.7
  2626. rgets function ......... 1.3.10
  2627. rgett function ......... 1.3.11
  2628. rgettm function ........ 1.3.12
  2629. rgetui function ........ 1.3.13
  2630. rgetul function ........ 1.3.14
  2631. ristxtfld function ..... 1.3.20
  2632. risvalid function ...... 1.8.7
  2633. rnames function ........ 1.7.6
  2634. rnumfld function ....... 1.7.8
  2635. ropen function  ........ 1.2.3
  2636. ROPEN_MAX macro ........ 1.1.3
  2637. rputc function ......... 1.4.5
  2638. rputd function ......... 1.4.6
  2639. rputf function ......... 1.4.7
  2640. rputi function ......... 1.4.8
  2641. rputl function ......... 1.4.9
  2642. rputrec function ....... 1.7.9
  2643. rputs function ......... 1.4.10
  2644. rputt function ......... 1.4.11
  2645. rputtm function ........ 1.4.12
  2646. rputui function ........ 1.4.13
  2647. rputul function ........ 1.4.14
  2648. rrecs function ......... 1.7.10
  2649. rrecno function ........ 1.7.11
  2650. rresetstr function ..... 1.7.12
  2651. rsetbegcolno function .. 1.7.7, 1.7.13
  2652. rsetcxtno function ..... 1.8.8
  2653. rseterr function ....... 1.8.9
  2654. rseterrfn function ..... 1.8.10
  2655. rsetfldch function ..... 1.3.15
  2656. rsetfldpos function .... 1.7.14
  2657. rsetfldsiz function .... 1.2.4
  2658. rsetfldstr function .... 1.7.15
  2659. rsetrecsiz function .... 1.2.5
  2660. rsetrecstr function .... 1.7.16
  2661. rsettmfmt function ..... 1.3.16
  2662. rsettxtch function ..... 1.3.17
  2663. rsetwarn function ...... 1.9.2
  2664. rsetwarnfn function .... 1.9.3
  2665. rskipfld function  ..... 1.3.18
  2666. rskipnfld function ..... 1.3.19
  2667. rstrerror function ..... 1.8.11
  2668. rstrwarning function ... 1.9.4
  2669. rwarning function ...... 1.9.5
  2670. rwarnstr function ...... 1.9.6
  2671.